import {useState} from "react";

/**
 * 自增按钮
 *
 * 点击后自增1 显示在按钮文本上
 * @returns {JSX.Element}
 * @constructor
 */
export default function IncrButton() {
    const [count, setCount] = useState(0);

    return (
        <button onClick={() => setCount((count) => count + 1)}>
            count is {count}
        </button>
    )
}
